<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万达营销流程管理系统</title>
<link href="${pageContext.request.contextPath}/Admin/second/css/css.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="js/ie6png.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('div,ul,li,a,p,img,body,dl,dt,dd');</script>
<![endif]-->
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ + ".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>

<script type="text/javascript" src="${ pageContext.request.contextPath }/Admin/Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
	$(function(){
		/* 全选操作 */
		$("#checkbox").click(function(){
			var flag=$("#checkbox").attr("checked");
			if(flag){
				$(".checkbox1").attr("checked",true);
			}else{
				$(".checkbox1").attr("checked",false);
			}
		})
		
		
		/* 单个或批量删除 */
		$("#ayichu").click(function(){
			var ids="";
			for(var i=0;i<$(".checkbox1").size();i++){
				var flag=$(".checkbox1")[i].checked;
				if(flag){
					if(i+1==$(".checkbox1").size()){
						ids=ids+$(".checkbox1")[i].id;
					}else{
						ids=ids+$(".checkbox1")[i].id+",";
					}
				}
			}
			if(ids==""){
				alert("请至少选择一个!");
            }else{
            	var mymessage=confirm("确认删除?");
    			if(mymessage==true){
    				alert("删除成功");
    				location.href="${pageContext.request.contextPath}/payMentType/deletePayMentTypeList.action?ids="+ids;
    			}
            }
			
			/* alert($(".checkbox1")[1].id) */
		})
		/* 跳转修改页面 */
		$("#axiugai").click(function(){
			var count=0;
			var checkbox;
			for(var i=0;i<$(".checkbox1").size();i++){
				var flag=$(".checkbox1")[i].checked;
				if(flag){
					count++;
					checkbox=$(".checkbox1")[i];
				}
			}
			if(count==0){
				alert("请选择一个");
			}
			if(count==1){
				var id=checkbox.id;
				location.href="${pageContext.request.contextPath}/payMentType/selectPayMentTypeById.action?id="+id;
			}
			if(count>1){
				alert("只能选择一个");
			}
		})
	})
</script>

<script>
<!--
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->
</script>
</head>
<body style="background: #fff;">
	<br />
	<div style="width: 900px;" class="tbox01 boxcenter">
		<div class="tbox02">
			<dl>
				<dt></dt>
				<dd>
					<div class="tbox02menu">
						<ul>
							
						</ul>
					</div>
				</dd>
			</dl>
		</div>
		<div class="tbox03">

		<div class="ybox07 margb2">
            <dl>
              <table border="0" cellspacing="0" cellpadding="0" class="ybox07table">
                <tr align="left">
                <td class="ybox07td1"><img src="../Admin/second/images/op4_6.gif" /></td>
                <td><a href="${pageContext.request.contextPath}/Admin/second/addFukuanfangshi.jsp" id="atianjia">添加付款方式</a></td>
                <td class="ybox07td2"><img src="../Admin/second/images/op4_0.gif"  /></td>
                <td class="ybox07td1"><img src="../Admin/second/images/op4_3.gif" /></td>
                <td><a href="#" id="ayichu">移除付款方式</a></td>
                <td class="ybox07td2"><img src="../Admin/second/images/op4_0.gif"  /></td>
                <td class="ybox07td1"><img src="../Admin/second/images/op4_6.gif" /></td>
                <td><a href="#" id="axiugai">修改付款方式</a></td>
                  
                </tr>
              </table>
            </dl>
          </div>

		
			<div class="tbox04a">
				<table width="100%" border="0" align="center" cellpadding="0"
					cellspacing="1" class="ybox06table">
					<tr>
						<td width="40" class="ybox06td01"><input type="checkbox"name="checkbox" id="checkbox" /></td>
						<td width="30" class="ybox06td01">序号</td>
						<td class="ybox06td01">付款方式名称</td>
						<td class="ybox06td01">优惠政策说明</td>
						<td class="ybox06td01">折扣</td>
						<td class="ybox06td01">期限</td>
						<td class="ybox06td01">每期还款金额</td>
						<td class="ybox06td01">开始还款日期</td>
						<td class="ybox06td01">截止还款时间</td>
					</tr>
					
					<c:forEach items="${payMentTypes }" var="payMentType" >
					
						<tr>
							<td class="ybox06td02wcenter"><input type="checkbox"name="checkbox2" id="${payMentType.id }" class="checkbox1" /></td>
							<td class="ybox06td02wcenter">${payMentType.id }</td>
							<td class="ybox06td02wleft">${payMentType.name }</td>
							<td class="ybox06td02wcenter">${payMentType.privilege }</td>
							<td class="ybox06td02wleft">${payMentType.discount }</td>
							<td class="ybox06td02wcenter">${payMentType.timelimit }</td>
							<td class="ybox06td02wleft">${payMentType.everydeadlinemoney }</td>
							<td class="ybox06td02wcenter"><fmt:formatDate value="${payMentType.deadline.begintime}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
							<td class="ybox06td02wleft"><fmt:formatDate value="${payMentType.deadline.endtime}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
						</tr>
					</c:forEach>
				</table>
				<div class="nums boxcenter black12">
					<a href="#" class="hovera">首 页</a><a href="#">上一页</a><a href="#">下一页</a><a
						href="#">尾 页</a>&nbsp;&nbsp;&nbsp;第1/3页&nbsp;&nbsp;&nbsp;每页&nbsp;
					<input name="textfield3" type="text" id="textfield" size="2" />
					&nbsp;条/共25条&nbsp;&nbsp;转到&nbsp; <input name="textfield3"
						type="text" id="textfield" size="2" /> &nbsp;页<a href="#">跳 转</a>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
